\input ../../default-cn-cfg.mkvi
\setupcaption[table][location=top,suffix=\floatcaptionsuffix]
%%%
\definextable[generalxtable]
\setupxtable[generalxtable][
split=yes,header=repeat,footer=repeat,
% foregroundstyle=\rm\tfx,%设置正文字体 ,\setupframed参数
textwidth=10cm,option=stretch,align={middle,lohi}
]

\definextable[headrow][generalxtable]
\setupxtable[headrow][
foregroundcolor=red,
foregroundstyle=\ss\tfx,%设置正文字体 ,\setupframed参数
frame=off,topframe=on,rulethickness=0.7pt
]

\definextable[footrow][generalxtable]
\setupxtable[footrow]
[
foregroundcolor=blue,
foregroundstyle=\rm\fsx,%设置正文字体 ,\setupframed参数
frame=off,bottomframe=on,rulethickness=0.7pt
]

\definextable[bodyrow][generalxtable]
\setupxtable[bodyrow][
% foregroundcolor=blue,
foregroundstyle=\rm\tfx,%设置正文字体 ,\setupframed参数
frame=off,
]

\definextable[firstrow][generalxtable]
\setupxtable[firstrow][
% foregroundcolor=blue,
foregroundstyle=\rm\tfx,%设置正文字体 ,\setupframed参数
frame=off,topframe=on,rulethickness=0.2pt
]

\definextable[alignedCell]
\setupxtable[alignedCell]
[
aligncharacter=yes,alignmentcharacter={,},
alignmentleftsample=000.0000,
alignmentrightsample=00
]

\definextable[alignedCellnext]
\setupxtable[alignedCellnext]
[
aligncharacter=yes
]
%%%%

\starttext

%\dorecurse{1}{ \input ../../hetangyuese/htys01.mkvi}
\startplacefloat[table][title=最简单表格,location={left}]
  \startxtable[generalxtable]
    \startxtablehead[headrow]
      \startxrow
        \startxcell  表头 一
        \stopxcell
        \startxcell  表头 2
        \stopxcell
        \startxcell[alignedCell]   表头 三
        \stopxcell
        \startxcell  表头 4
        \stopxcell
      \stopxrow
    \stopxtablehead
    \startxtablefoot[footrow]
      \startxrow
        \startxcell  表脚 1
        \stopxcell
        \startxcell  表脚 2
        \stopxcell
        \startxcell  表脚 3
        \stopxcell
        \startxcell  表脚 4
        \stopxcell
      \stopxrow
    \stopxtablefoot

    \startxtablebody[bodyrow]
      \startxrow[firstrow]
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell] 123.456,78
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

      \startxrow
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell] 123.4567,8
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

      \startxrow
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell]   456.00
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

      \startxrow
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell]  23.456
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

      \startxrow
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell]  7.89
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

      \startxrow
        \startxcell  行\low{\recurselevel}格1
        \stopxcell
        \startxcell  行\low{\recurselevel}格2
        \stopxcell
        \startxcell[alignedCell]  7.8
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow

    \stopxtablebody

  \stopxtable
\stopplacefloat
%%% 自定义样式： 进行列单元的数字对齐
\definextable[ExtCell]
\setupxtable[ExtCell][
%align={flushright,lohi},
aligncharacter=yes,
alignmentcharacter={.},
alignmentleftsample=100,
alignmentrightsample=00
]

\startplacefloat[table][title=最简单表格,location={middle}]
  \startxtable
    \startxrow
      \startxcell[ExtCell]  1.0
      \stopxcell
    \stopxrow
    %
    \startxrow
      \startxcell[ExtCell] 1.1
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell[ExtCell] 11.11
      \stopxcell
    \stopxrow
    %
  \stopxtable
\stopplacefloat

%%% 直接输入命名参数： 进行列单元的数字对齐
\startplacefloat[table][title=最简单表格,location={middle}]
  \startxtable[align={flushright,lohi}]
    \startxrow
      \startxcell
        [aligncharacter=yes,
        alignmentcharacter={,},
        alignmentleftsample=000.000,
      alignmentrightsample=00]
        123.456,78
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell
        [aligncharacter=yes]
        456
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell
        [aligncharacter=yes]
        23.456
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell
        [aligncharacter=yes]
        78,9
      \stopxcell
    \stopxrow
    \startxrow
      \startxcell
        [aligncharacter=yes]
        78
      \stopxcell
    \stopxrow
  \stopxtable
\stopplacefloat

\definextable[
aligneddanyuange]
\setupxtable
[aligneddanyuange]
[aligncharacter=yes,
alignmentleftsample=000.000,
alignmentrightsample=00,
alignmentcharacter={,}]

\startxtable
  \startxrow
    \startxcell[aligneddanyuange] d随意文字sfds3
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell[aligneddanyuange] 123.456,78 x
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell[aligneddanyuange]
      456            x
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell[aligneddanyuange] 23.456  x
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell[aligneddanyuange]
      78,9  x
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell[aligneddanyuange]
      78  x
    \stopxcell 
  \stopxrow
\stopxtable

\stoptext
